home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / ShellPanel / ShellPanel_ReadMe < prev   
INI File  |  1995-06-12  |  5KB  |  112 lines

  1. [This is an updated version of ShellPanel that has been built under 3.0 - cdl]
  2.  
  3. Alert, Menu, Open and Save are simple wrappers for the NextSTEP
  4. NXRunAlertPanel routine and OpenPanel and SavePanel objects that allow
  5. them to be used from (interactive) Unix shell scripts (to provide
  6. consistent GUI panels across C and shell executables).
  7.  
  8. NIDomain, NIOpen and NISave are wrappers for the NIKit NIDomainPanel,
  9. NIOpenPanel and NISavePanel objects that allow them to be used from
  10. Unix shell scripts.  (The included wrapper for NILoginPanel doesn't work.)
  11.  
  12. Alert takes the message to display and three button labels as arguments:
  13.  
  14.     Alert [message] [defaultButton] [alternateButton] [otherButton]
  15.     
  16. All arguments are optional--buttons are not drawn if labels are not
  17. supplied.  The return value of NXRunAlertPanel is remapped into something
  18. useful for shell scripts; for the first (default) button (first button
  19. argument but first from the right on the panel), it returns 0 (success),
  20. otherwise 1 or 2 for the other buttons and 3 on error.
  21.  
  22. Thus, you can do things like:
  23.  
  24.     Alert 'Are you sure?' 'Yes' 'No' 'Help'
  25.     if ( $status == 2 ) ...
  26.         
  27. There is no access to the printf-like features of NXRunAlertPanel as you
  28. can provide the same functionality from within the shell script language,
  29. eg:  Alert "Using the current time (`date`)"
  30.  
  31. The title of the alert panel is taken from the title of the program, so you
  32. can have a Warning panel by doing 'ln -s Alert Warning' where Alert is
  33. stored (eg. /usr/local/bin). 
  34.  
  35. Menu takes several optional arguments and at least one required menu item:
  36.  
  37.     Menu [-c char] [-t title] [-x xpos -y ypos] [-T seconds] item [item [...]]
  38.  
  39. Where char is the character from which to start assigning key equivalents
  40. ('1' by default) , title is the title of the menu (the name of the Menu
  41. program by default), xpos and ypos are the coordinates where the menu
  42. should be displayed (upper left corner by default)--both positions must
  43. be specified if either is and seconds is the time to wait before timing
  44. out (30 seconds by default)--a value of 0 prevents a timeout.
  45.  
  46. Menu exits with status = 0 on success (a menu item was selected) and prints
  47. the selected item to stdout .  If the menu timeout occurs, it exits with
  48. status = 1 (failure) and prints nothing.  If given bad arguments, it exits
  49. with status = 2 and prints a usage message to stderr.  An example use of
  50. Menu from csh:
  51.  
  52.     set zones = `find /etc/zoneinfo ! -name '*GMT*' -type f -exec basename {} \;`
  53.     set zone = `Menu -t 'Select Time Zone' $zones`
  54.     if ($status == 0) setenv TZ $zone
  55.  
  56. Open and Save take several optional arguments:
  57.  
  58.     Open [-f file] [-d directory] [-t type [-t type]] [-p prompt] [-T title] [-m] [-c]
  59.     Save [-f file] [-d directory] [-t type] [-p prompt] [-T title] [-u]
  60.     
  61. Where file is the file to display in the form field of the panel, directory
  62. is the directory to display in the browser portion of the panel, type is
  63. the type (extension) of file(s) to accept (Open can accept multiple type
  64. arguments), prompt is the title of the form field (defaults to Name:) and
  65. title is the panel title (defaults to Open or Save).  The -m option to Open
  66. allows multiple file selection and the -c option allows the user to choose
  67. directories.  The -u option to Save allows the user to travel inside file
  68. packages.
  69.  
  70. Both Open and Save exit with status = 0 on success and print the (fully
  71. expanded) file name(s) to stdout (one per line).  If the user selects
  72. Cancel, they exit with status = 1 (failure) and print nothing.  If given
  73. bad arguments, they exit with status = 2 and print a usage message to stderr.
  74.  An example using Open from csh:
  75.  
  76.     set files = `Open -t txt -m`
  77.     if ($status == 0) then
  78.         cat $files
  79.     else
  80.         echo 'no files selected'
  81.     endif
  82.     
  83. NIDomain doesn't take any arguments and exits with status = 0 on success
  84. (a domain was selected) and prints the selected domain name to stdout .
  85. If given bad arguments, it exits with status = 2 and prints a usage message
  86. to stderr.  If the user selects Cancel, it exits with status = 3 (cancel)
  87. and prints nothing.
  88.  
  89. NIOpen and NISave take several optional arguments:
  90.  
  91.     NIOpen [-d directory] [-t title] [-p prompt]
  92.     NISave [-d directory] [-t title] [-p prompt] [-f directory] 
  93.     
  94. Where directory is the NetInfo directory to display in the domain browser
  95. portion of the panel, title is the title printed at the top of the panel
  96. and prompt is the title of the form field (defaults to List Title:).
  97. The -f option to NISave sets the initially selected directory.
  98.  
  99. Both NIOpen and NISave exit with status = 0 on success and print the
  100. (fully expanded) file name(s) to stdout (one per line).  If the user
  101. selects Cancel, they exit with status = 3 (cancel) and print nothing.
  102. If given bad arguments, they exit with status = 2 and print a usage
  103. message to stderr. 
  104.     
  105. All the panels display the default NeXT logo as their application icon.
  106.  
  107. Comments and/or suggestions welcome.
  108.  
  109. Christopher Lane (lane@sumex-aim.stanford.edu).
  110.  
  111. Copyright 1990, 1991 & 1992 by The Leland Stanford Junior University.
  112.